//
//  NSString+LKPredicate.m
//  YuxiCloud
//
//  Created by LIUKUN-PC on 17/3/3.
//  Copyright © 2017年 ynnissi. All rights reserved.
//

#import "NSString+LKPredicate.h"

@implementation NSString (LKPredicate)

- (BOOL)matchWithRegex:(NSString *)regex {
    
    NSPredicate *pred = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regex];    //Cocoa框架中的NSPredicate用于查询，原理和用法都类似于SQL中的where，作用相当于数据库的过滤取
    return [pred evaluateWithObject:self];
}

@end
